home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-18 | 2.6 KB | 130 lines | [mlts/slnk] |
- ! From: werner@soe.berkeley.edu (John Werner)
- ! Newsgroups: comp.sys.mac.comm
- ! Subject: Re: SLIP on a Xylogics Annex
- ! Date: Sun, 17 Oct 1993 11:28:02 -0800
- !
- ! [...stuff deleted...]
- !
- ! Here's the script we're using at UC Berkeley. I think
- ! it's derived from a Cisco script, and most of it isn't used.
- ! We have static IP addresses, so this script doesn't bother
- ! parsing the addreses the Annex prints.
- !
- ! InterSLIP gateway script for Annex terminal server
- !
- ! Label 99 is the general purpose error handler, which beeps
- ! and pauses long enough for the user to read the message.
- !
- ! First, we wait for the user name prompt
- !
- @originate
- note "Waiting for prompt"
- pause 30
- write "\13"
- matchclr
- matchstr 1 100 "==>"
- matchread 250
- note "No prompt"
- jump 99
- !
- !go into slip mode!!
- !
- @label 100
- note "Entering slip mode"
- write "slip\13"
- matchclr
- matchstr 1 1 "Username:"
- matchread 50
- note "No username prompt"
- jump 99
- !
- ! Now, send the user name and wait for the password prompt
- !
- @label 1
- note "Sending user name"
- write "^5\13"
- matchclr
- matchstr 1 2 "Password:"
- matchread 50
- note "No password prompt"
- jump 99
- !
- ! Send the password and wait for either the terminal server
- ! prompt or an error message
- !
- @label 2
- note "Sending password"
- write "^6\13"
- matchclr
- matchstr 1 7 "Switching to SLIP"
- matchstr 2 3 "Access denied"
- matchread 120
- jump 99
- !
- ! If we got an error message, notify the user and fail
- !
- @label 3
- note "Access Denied"
- !
- ! General purpose error handler. Let the message appear,
- ! beep, and then pause for a second.
- !
- @label 99
- pause 1
- sound
- pause 60
- exit -1
- !
- ! If we've successfully logged in, ask for SLIP mode and
- ! wait for the response. If we get anything except
- ! "Entering SLIP mode.", assume something went wrong, and fail.
- !
- !Skip this!
- !
- @label 4
- note "Switching to SLIP"
- !write "slip\13"
- matchclr
- matchstr 1 7 "Switching to SLIP"
- matchread 120
- note "Cannot invoke SLIP mode"
- jump 99
- !
- ! We've entered SLIP mode, so match on the first thing that
- ! looks like an IP address. If we don't find one, fail.
- !
- !Skip this!
- !
- @label 5
- matchclr
- matchexp 1 6 "[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\."
- matchread 120
- note "No IP address given"
- jump 99
- !
- ! We've found an IP address, so inform MacTCP of it, and
- ! watch for a number (the MTU size).
- !
- !Skip this!
- !
- @label 6
- setip "^0"
- matchclr
- matchexp 1 7 "[0-9][0-9]*"
- matchread 120
- note "No MTU value"
- jump 99
- !
- ! We found the MTU size, so inform MacTCP and exit
- ! the script successfully.
- !
- @label 7
- !setmtu "^0"
- exit 0
- !
- ! Answer and Hangup modes are currently unused in gateway
- ! scripts, but just for future compatibility, exit successfully.
- !
- @answer
- @hangup
- exit 0